package etnorservice.etnor_service.mapper;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: cc
 * @Date: 2024/11/30/11:10
 **/

import etnorservice.etnor_service.domain.po.Like;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;

@Mapper
public interface LikeMapper {
    // 插入点赞记录
    int insert(Like like);

    // 删除点赞记录
    int delete(Long userId, Long targetId, Integer targetType);

    // 查询用户是否点赞
    Like findByUserIdAndTarget(Long userId, Long targetId, Integer targetType);

    // 获取目标的点赞数
    int countByTarget(Long targetId, Integer targetType);
}
